/**
 *Copyright (c) 2024 watereyes
 * workflow is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.workflow.systemManag.service;

import com.koron.workflow.common.bean.PageBean;
import com.koron.workflow.common.bean.StaffBean;
import com.koron.workflow.systemManag.bean.AdministratorBean;
import com.koron.workflow.systemManag.bean.AdministratorQueryBean;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

import java.util.List;
import java.util.Map;

/**
 * 系统用户管理
 */
public interface AdministratorService {
    /**
     * 根据条件查询 系统用户管理 列表
     *
     * @param factory
     * @param account       用户账号
     * @param name          用户名称
     * @param supperManager 是否是管理员  0:否，1:是
     * @param page
     * @param pageSize
     * @return
     */
    PageBean queryForList(SessionFactory factory, String account, String name,
                          Integer supperManager, Integer page, Integer pageSize);

    /**
     * 根据ID查询系统用户管理
     *
     * @param factory
     * @param id
     * @return
     */
    AdministratorQueryBean queryForObject(SessionFactory factory, String id);

    /**
     * 保存系统用户管理
     *
     * @param user
     * @param bean
     * @return
     */
    MessageBean save(SessionFactory factory, StaffBean user, AdministratorBean bean);

    /**
     * 修改系统用户管理
     *
     * @param user
     * @param bean
     * @return
     */
    MessageBean update(SessionFactory factory, StaffBean user, AdministratorBean bean);

    /**
     * 删除系统用户管理
     *
     * @param id
     * @return
     */
    MessageBean delete(SessionFactory factory, String id);

    /**
     * 根据ID查询系统用户所属用户
     *
     * @param factory
     * @param id
     * @return
     */
    List<Map> queryAppsById(SessionFactory factory, String id);
}
